﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using BBICMS.Model.Works;
using BBICMS.Resources;

namespace BBICMS.Application.InputModels.Works
{
    public class WorkIM
    {
        [Key]
        public int Id { get; set; }
        [Display(ResourceType = typeof(Labels), Name = "Title", Prompt = "Required")]
        [Required(ErrorMessageResourceType = typeof(Validations), ErrorMessageResourceName = "Required")]
        public string Title { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "Solution")]
        [Required(ErrorMessageResourceType = typeof(Validations), ErrorMessageResourceName = "RequiredSelect")]
        public int SolutionId { get; set; }

        [Display(Name = "ClientName", ResourceType = typeof(Labels))]   
        public int? ClientId { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "FinishYear", Prompt = "Required")]
        [Required(ErrorMessageResourceType = typeof(Validations), ErrorMessageResourceName = "Required")]
        [RegularExpression(@"^-?\d*$", ErrorMessageResourceType = typeof(Labels), ErrorMessageResourceName = "FormatInvalid")]
        public int FinishYear { get; set; }

        [Display(Name = "KeyWords", ResourceType = typeof(Labels))]
        public string KeyWords { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "Description")]
        public string Abstract { get; set; }

        [Display(Name = "Content", ResourceType = typeof(Labels))]
        public string Body { get; set; }

        [Display(Name = "ViewCount", ResourceType = typeof(Labels))]
        public int ViewCount { get; set; }

        [Display(Name = "Thumbnail", ResourceType = typeof(Labels), Prompt = "Required")]
        [Required(ErrorMessageResourceType = typeof(Validations), ErrorMessageResourceName = "Required")]
        public string Thumbnail { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "FullImage")]
        public string ImageUrl { get; set; }

        [Display(Name = "Demourl", ResourceType = typeof(Labels))]
        [Url(ErrorMessageResourceType = typeof(Labels), ErrorMessageResourceName = "FormatInvalid", ErrorMessage = null)]
        public string Demourl { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "Recommend")]
        public bool Recommend { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "Active")]
        public bool Active { get; set; }


        public string TypeIds { get; set; }

        [Display(ResourceType = typeof(Labels), Name = "Category")]
        public string[] WorkTypesIds { get; set; }

        public virtual ICollection<WorkType> WorkTypes { get; set; }
    }
}
